-
Notifications
You must be signed in to change notification settings - Fork 803
Fix SV_PrimitiveID in GSVIn #7624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… compiles now also allow fvk-invert-y.
…t; avoids pixel shader from inverting SV_POSITION.y in a lib file
…nly supported on GS/VS/DS/MS already. Added test case for fvk-invert-y for lib files
…owed to be flipped
…PrimitiveID from Vertex->Geometry shaders (GSVIn) even though according to the spec it should be allowed. This breaks existing shaders but only if they're compiled as lib file (compiling it with gs_ is fine). This is because the value in this table is NA, which results in the semantic becoming invalid and down the road that results in this error: "Semantic 'SV_PrimitiveID' is invalid as gs Input."
…iler into fix_sv_primitive_id_in_gsvin
|
Fixes #7625 |
|
We generally need changes to come with tests, especially if they're addressing things that should have been caught by tests but weren't. |
|
Yes, my bad, I've been adding them to my PRs today, but was stuck on the keep all resources one. The first PR was easy, since I could manually run dxc with the right arguments, but the D3DReflect one needed the full build test suite to run (which isn't so user friendly). This one should be easy to add a test for, will take 5 min for me. |
|
On a second thought, this happened in a shader at my old workplace (I wasn't able to repro it as easily as I thought) . Since this monday I have no access to the source anymore, I'm asking for their help on getting the repro for the shader I lost access to. After that, I'll continue this. |
|
This PR is not the correct fix for the issue. This change means that The interpretation of "Shadow" means that there's an element included in the signature, but the value is loaded through some specialized intrinsic instead. That is the correct interpretation for SV_PrimitiveID in GS. The SigPoint location is in This issue is caused by a bug when copying the input signature from the library module. In The bug was easy to fix once understood, so I put up a PR: #7872. |
|
@tex3d thank you for looking at this, and fixing it the correct way 👌 I'm still learning my way through the codebase, I did see the "Shadow" there, I just wasn't sure what it was exactly shadowing. Your explanation makes sense. |
GSVIn doesn't permit usage of SV_PrimitiveID, even though according to the spec this is allowed.
This happens if you try to compile GS with SV_PrimitiveID with lib_ target rather than gs_.
This can break some shaders that can use IDxcLinker together with lib_.